/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * panelIndex.java
 *
 * Created on 22-jun-2011, 9:37:51
 */

package generadordeclasesv003.Vista;

import GeneradordeClases.Mensajes.MensajesAMostrar;
import generadordeclasesv003.Controlador.ClaseValidacion;
import generadordeclasesv003.Controlador.Controlador_GestorDeClases;
import generadordeclasesv003.Controlador.Controlador_GestorDeCodigo;
import generadordeclasesv003.Modelo.AccesoEnum;
import generadordeclasesv003.Modelo.Atributo;
import generadordeclasesv003.Modelo.Clase;
import generadordeclasesv003.Modelo.ClaseModelo;
import generadordeclasesv003.Modelo.EnumMultiplicidad;
import java.util.ArrayList;
import java.util.Iterator;
import javax.swing.DefaultListModel;
import javax.swing.JRadioButton;


/**
 *
 * @author Administrador
 */
public class panelIndex extends javax.swing.JPanel {
private static panelIndex in;
private  DefaultListModel modelListaAtributos;

    /** Creates new form panelIndex */
    public panelIndex() {
        initComponents();

          modelListaAtributos=new DefaultListModel();
      ListaAtributos.setModel(modelListaAtributos);
        GrupodeClasesRadio();
       GrupoAtributosRadio();
        radio_Clase_Public.setSelected(true);
        radio_Atributo_Public.setSelected(true);
        Controlador_GestorDeClases.getInstancia();

    }



 public void GrupodeClasesRadio(){
      buttonGroup1.add(radio_Clase_Private);
      buttonGroup1.add(radio_Clase_Protected);
      buttonGroup1.add(radio_Clase_Public);
    }
    public void GrupoAtributosRadio(){
      buttonGroup2.add(radio_Atributo_Private);
      buttonGroup2.add(radio_Atributo_Protected);
      buttonGroup2.add(radio_Atributo_Public);
    }


public static panelIndex getInstancia(){
    if(in==null){
        in=new panelIndex();
    }
    return in;
}

public void setearModeloListaAtributos(){
 modelListaAtributos.clear();
}

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        buttonGroup1 = new javax.swing.ButtonGroup();
        buttonGroup2 = new javax.swing.ButtonGroup();
        jTabbedPane1 = new javax.swing.JTabbedPane();
        jPanel1 = new javax.swing.JPanel();
        jPanel5 = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        txtNombreClase = new javax.swing.JTextField();
        jPanel6 = new javax.swing.JPanel();
        radio_Clase_Public = new javax.swing.JRadioButton();
        radio_Clase_Protected = new javax.swing.JRadioButton();
        radio_Clase_Private = new javax.swing.JRadioButton();
        chkExtend = new javax.swing.JCheckBox();
        txt_clasequeExtiende = new javax.swing.JTextField();
        jLabel2 = new javax.swing.JLabel();
        jPanel7 = new javax.swing.JPanel();
        jPanel8 = new javax.swing.JPanel();
        radio_Atributo_Public = new javax.swing.JRadioButton();
        radio_Atributo_Private = new javax.swing.JRadioButton();
        radio_Atributo_Protected = new javax.swing.JRadioButton();
        jLabel3 = new javax.swing.JLabel();
        txtNombreAtributo = new javax.swing.JTextField();
        jLabel4 = new javax.swing.JLabel();
        jLabel8 = new javax.swing.JLabel();
        ComboMultiplicidad = new javax.swing.JComboBox();
        ckOpcional = new javax.swing.JCheckBox();
        ckEsEnumeracion = new javax.swing.JCheckBox();
        jLabel10 = new javax.swing.JLabel();
        jScrollPane3 = new javax.swing.JScrollPane();
        areaObservaciones = new javax.swing.JTextArea();
        txt_paqueteEnumeracion = new javax.swing.JTextField();
        ComboClasesExistetnes = new javax.swing.JComboBox();
        Paquete = new javax.swing.JLabel();
        jScrollPane1 = new javax.swing.JScrollPane();
        ListaAtributos = new javax.swing.JList();
        jToolBar1 = new javax.swing.JToolBar();
        Boton_AgregarATRIBUTO_Lista = new javax.swing.JButton();
        jSeparator1 = new javax.swing.JToolBar.Separator();
        boton_Eliminar_Metodo = new javax.swing.JButton();
        jSeparator2 = new javax.swing.JToolBar.Separator();
        Boton_GuardarClase = new javax.swing.JButton();
        jSeparator3 = new javax.swing.JToolBar.Separator();
        boton_GenerarClase = new javax.swing.JButton();
        boton_buscarClases = new javax.swing.JButton();
        jPanel2 = new javax.swing.JPanel();
        jPanel3 = new javax.swing.JPanel();
        jPanel9 = new javax.swing.JPanel();
        txtNombreTabla = new javax.swing.JTextField();
        jLabel5 = new javax.swing.JLabel();
        txtPK = new javax.swing.JTextField();
        jLabel6 = new javax.swing.JLabel();
        jLabel14 = new javax.swing.JLabel();
        txtPK1 = new javax.swing.JTextField();
        jPanel10 = new javax.swing.JPanel();
        jLabel7 = new javax.swing.JLabel();
        txtNombreColumnaAtributo = new javax.swing.JTextField();
        jPanel11 = new javax.swing.JPanel();
        CheckIsNull = new javax.swing.JCheckBox();
        jLabel9 = new javax.swing.JLabel();
        txt_leng = new javax.swing.JTextField();
        jPanel12 = new javax.swing.JPanel();
        jLabel12 = new javax.swing.JLabel();
        txtNombreTablaCruzada = new javax.swing.JTextField();
        jLabel13 = new javax.swing.JLabel();
        txt_IDTablaHija = new javax.swing.JTextField();
        jLabel11 = new javax.swing.JLabel();
        txt_IDtabla_Padre = new javax.swing.JTextField();
        jPanel13 = new javax.swing.JPanel();
        comboNombreClase = new javax.swing.JComboBox();
        jScrollPane2 = new javax.swing.JScrollPane();
        jList2 = new javax.swing.JList();
        jToolBar2 = new javax.swing.JToolBar();
        Agregar1 = new javax.swing.JButton();
        jSeparator4 = new javax.swing.JToolBar.Separator();
        jButton4 = new javax.swing.JButton();
        jSeparator5 = new javax.swing.JToolBar.Separator();
        jButton5 = new javax.swing.JButton();
        jSeparator6 = new javax.swing.JToolBar.Separator();
        jButton6 = new javax.swing.JButton();
        jButton3 = new javax.swing.JButton();

        jPanel5.setBorder(javax.swing.BorderFactory.createTitledBorder("Datos Clase"));
        jPanel5.setForeground(new java.awt.Color(51, 51, 255));

        jLabel1.setText("Nombre:");

        txtNombreClase.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusLost(java.awt.event.FocusEvent evt) {
                txtNombreClaseFocusLost(evt);
            }
        });

        jPanel6.setBorder(javax.swing.BorderFactory.createTitledBorder("Acceso"));

        radio_Clase_Public.setText("Public");

        radio_Clase_Protected.setText("Protected");

        radio_Clase_Private.setText("Private");

        javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6);
        jPanel6.setLayout(jPanel6Layout);
        jPanel6Layout.setHorizontalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel6Layout.createSequentialGroup()
                .addGap(20, 20, 20)
                .addComponent(radio_Clase_Public)
                .addGap(18, 18, 18)
                .addComponent(radio_Clase_Protected)
                .addGap(18, 18, 18)
                .addComponent(radio_Clase_Private)
                .addContainerGap(18, Short.MAX_VALUE))
        );
        jPanel6Layout.setVerticalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel6Layout.createSequentialGroup()
                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(radio_Clase_Public)
                    .addComponent(radio_Clase_Protected)
                    .addComponent(radio_Clase_Private))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        chkExtend.setText("Extiende ?");
        chkExtend.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                chkExtendItemStateChanged(evt);
            }
        });

        txt_clasequeExtiende.setEditable(false);

        jLabel2.setText("Clase que Extiende");

        javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
        jPanel5.setLayout(jPanel5Layout);
        jPanel5Layout.setHorizontalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel5Layout.createSequentialGroup()
                        .addContainerGap()
                        .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(chkExtend)
                            .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel5Layout.createSequentialGroup()
                                    .addComponent(jLabel2)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(txt_clasequeExtiende))
                                .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel5Layout.createSequentialGroup()
                                    .addComponent(jLabel1)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(txtNombreClase, javax.swing.GroupLayout.PREFERRED_SIZE, 190, javax.swing.GroupLayout.PREFERRED_SIZE)))))
                    .addGroup(jPanel5Layout.createSequentialGroup()
                        .addGap(32, 32, 32)
                        .addComponent(jPanel6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addGap(41, 41, 41))
        );
        jPanel5Layout.setVerticalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addComponent(jPanel6, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel1)
                    .addComponent(txtNombreClase, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(chkExtend)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel2)
                    .addComponent(txt_clasequeExtiende, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
        );

        jPanel7.setBorder(javax.swing.BorderFactory.createTitledBorder("Atributo"));

        jPanel8.setBorder(javax.swing.BorderFactory.createTitledBorder("Acceso"));

        radio_Atributo_Public.setText("Public");

        radio_Atributo_Private.setText("Private");

        radio_Atributo_Protected.setText("Protected");

        javax.swing.GroupLayout jPanel8Layout = new javax.swing.GroupLayout(jPanel8);
        jPanel8.setLayout(jPanel8Layout);
        jPanel8Layout.setHorizontalGroup(
            jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel8Layout.createSequentialGroup()
                .addComponent(radio_Atributo_Public)
                .addGap(18, 18, 18)
                .addComponent(radio_Atributo_Protected, javax.swing.GroupLayout.PREFERRED_SIZE, 81, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(30, 30, 30)
                .addComponent(radio_Atributo_Private)
                .addContainerGap(11, Short.MAX_VALUE))
        );
        jPanel8Layout.setVerticalGroup(
            jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel8Layout.createSequentialGroup()
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(radio_Atributo_Public)
                    .addComponent(radio_Atributo_Private)
                    .addComponent(radio_Atributo_Protected))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jLabel3.setText("Nombre:");

        jLabel4.setText("Tipo :");

        jLabel8.setText("Multiplicidad:");

        ComboMultiplicidad.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "0..1", "0..*", "1..1", "1..*", "*..*" }));
        ComboMultiplicidad.setPreferredSize(new java.awt.Dimension(6, 20));

        ckOpcional.setText("Opcional");

        ckEsEnumeracion.setText("EsEnumeracion");
        ckEsEnumeracion.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                ckEsEnumeracionItemStateChanged(evt);
            }
        });
        ckEsEnumeracion.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ckEsEnumeracionActionPerformed(evt);
            }
        });

        jLabel10.setText("Observaciones:");

        areaObservaciones.setColumns(20);
        areaObservaciones.setRows(5);
        jScrollPane3.setViewportView(areaObservaciones);

        txt_paqueteEnumeracion.setEditable(false);

        ComboClasesExistetnes.setEditable(true);
        ComboClasesExistetnes.setPreferredSize(new java.awt.Dimension(6, 20));
        ComboClasesExistetnes.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                ComboClasesExistetnesItemStateChanged(evt);
            }
        });
        ComboClasesExistetnes.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusLost(java.awt.event.FocusEvent evt) {
                ComboClasesExistetnesFocusLost(evt);
            }
        });

        Paquete.setText("Paquete");

        ListaAtributos.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
        ListaAtributos.addListSelectionListener(new javax.swing.event.ListSelectionListener() {
            public void valueChanged(javax.swing.event.ListSelectionEvent evt) {
                ListaAtributosValueChanged(evt);
            }
        });
        jScrollPane1.setViewportView(ListaAtributos);

        jToolBar1.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.RAISED));
        jToolBar1.setRollover(true);

        Boton_AgregarATRIBUTO_Lista.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Iconos/Arrow Down_16x16-32.gif"))); // NOI18N
        Boton_AgregarATRIBUTO_Lista.setText("Agregar");
        Boton_AgregarATRIBUTO_Lista.setEnabled(false);
        Boton_AgregarATRIBUTO_Lista.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                Boton_AgregarATRIBUTO_ListaActionPerformed(evt);
            }
        });
        jToolBar1.add(Boton_AgregarATRIBUTO_Lista);
        jToolBar1.add(jSeparator1);

        boton_Eliminar_Metodo.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Iconos/Delete_01_16x16-32.gif"))); // NOI18N
        boton_Eliminar_Metodo.setText("Eliminar");
        boton_Eliminar_Metodo.setEnabled(false);
        boton_Eliminar_Metodo.setFocusable(false);
        boton_Eliminar_Metodo.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);
        boton_Eliminar_Metodo.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        boton_Eliminar_Metodo.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                boton_Eliminar_MetodoMouseClicked(evt);
            }
        });
        jToolBar1.add(boton_Eliminar_Metodo);
        jToolBar1.add(jSeparator2);

        Boton_GuardarClase.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Iconos/FloppyBlue2_16x16-32.gif"))); // NOI18N
        Boton_GuardarClase.setText("Guardar");
        Boton_GuardarClase.setFocusable(false);
        Boton_GuardarClase.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);
        Boton_GuardarClase.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        Boton_GuardarClase.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                Boton_GuardarClaseActionPerformed(evt);
            }
        });
        jToolBar1.add(Boton_GuardarClase);
        jToolBar1.add(jSeparator3);

        boton_GenerarClase.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Iconos/application-next_16x16-32.gif"))); // NOI18N
        boton_GenerarClase.setText("Generar Mappings");
        boton_GenerarClase.setFocusable(false);
        boton_GenerarClase.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);
        boton_GenerarClase.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        jToolBar1.add(boton_GenerarClase);

        javax.swing.GroupLayout jPanel7Layout = new javax.swing.GroupLayout(jPanel7);
        jPanel7.setLayout(jPanel7Layout);
        jPanel7Layout.setHorizontalGroup(
            jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel7Layout.createSequentialGroup()
                .addGap(14, 14, 14)
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel7Layout.createSequentialGroup()
                        .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel7Layout.createSequentialGroup()
                                .addComponent(jLabel3)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(txtNombreAtributo, javax.swing.GroupLayout.DEFAULT_SIZE, 239, Short.MAX_VALUE))
                            .addGroup(jPanel7Layout.createSequentialGroup()
                                .addGap(14, 14, 14)
                                .addComponent(jLabel4)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(ComboClasesExistetnes, javax.swing.GroupLayout.PREFERRED_SIZE, 143, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(18, 18, 18)
                                .addComponent(ckOpcional)
                                .addGap(11, 11, 11))
                            .addComponent(jLabel10)
                            .addGroup(jPanel7Layout.createSequentialGroup()
                                .addGap(1, 1, 1)
                                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(jPanel7Layout.createSequentialGroup()
                                        .addComponent(jLabel8)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(ComboMultiplicidad, javax.swing.GroupLayout.PREFERRED_SIZE, 56, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addGap(18, 18, 18)
                                        .addComponent(ckEsEnumeracion))
                                    .addGroup(jPanel7Layout.createSequentialGroup()
                                        .addComponent(Paquete)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(txt_paqueteEnumeracion, javax.swing.GroupLayout.DEFAULT_SIZE, 239, Short.MAX_VALUE)))))
                        .addGap(117, 117, 117))
                    .addGroup(jPanel7Layout.createSequentialGroup()
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                            .addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 325, Short.MAX_VALUE)
                            .addComponent(jScrollPane3, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 320, javax.swing.GroupLayout.PREFERRED_SIZE))))
                .addContainerGap())
            .addGroup(jPanel7Layout.createSequentialGroup()
                .addGap(41, 41, 41)
                .addComponent(jPanel8, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGap(106, 106, 106))
            .addGroup(jPanel7Layout.createSequentialGroup()
                .addComponent(jToolBar1, javax.swing.GroupLayout.PREFERRED_SIZE, 347, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(68, Short.MAX_VALUE))
        );
        jPanel7Layout.setVerticalGroup(
            jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel7Layout.createSequentialGroup()
                .addComponent(jPanel8, javax.swing.GroupLayout.PREFERRED_SIZE, 51, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel3)
                    .addComponent(txtNombreAtributo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel4)
                    .addComponent(ComboClasesExistetnes, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(ckOpcional))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel8)
                    .addComponent(ComboMultiplicidad, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(ckEsEnumeracion))
                .addGap(10, 10, 10)
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(Paquete)
                    .addComponent(txt_paqueteEnumeracion, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jLabel10)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 68, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jToolBar1, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        boton_buscarClases.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Iconos/0025-search.gif"))); // NOI18N
        boton_buscarClases.setText("Buscar Clase");
        boton_buscarClases.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                boton_buscarClasesActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(boton_buscarClases)
                    .addComponent(jPanel7, javax.swing.GroupLayout.DEFAULT_SIZE, 364, Short.MAX_VALUE)
                    .addComponent(jPanel5, javax.swing.GroupLayout.DEFAULT_SIZE, 364, Short.MAX_VALUE))
                .addGap(25, 25, 25))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(boton_buscarClases, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel7, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );

        jTabbedPane1.addTab("Clase", jPanel1);

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 399, Short.MAX_VALUE)
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 695, Short.MAX_VALUE)
        );

        jTabbedPane1.addTab("Modelo", jPanel2);

        jPanel9.setBorder(javax.swing.BorderFactory.createTitledBorder("Nombre Tabla y PK"));

        jLabel5.setText("Tabla:");

        jLabel6.setText("PK:");

        jLabel14.setText("GeneratedBy.Native");

        javax.swing.GroupLayout jPanel9Layout = new javax.swing.GroupLayout(jPanel9);
        jPanel9.setLayout(jPanel9Layout);
        jPanel9Layout.setHorizontalGroup(
            jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel9Layout.createSequentialGroup()
                .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addGroup(jPanel9Layout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jLabel14, javax.swing.GroupLayout.PREFERRED_SIZE, 104, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(txtPK1))
                    .addGroup(jPanel9Layout.createSequentialGroup()
                        .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel9Layout.createSequentialGroup()
                                .addGap(12, 12, 12)
                                .addComponent(jLabel6, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(jPanel9Layout.createSequentialGroup()
                                .addGap(2, 2, 2)
                                .addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE)))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(txtNombreTabla, javax.swing.GroupLayout.PREFERRED_SIZE, 250, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(txtPK, javax.swing.GroupLayout.PREFERRED_SIZE, 250, javax.swing.GroupLayout.PREFERRED_SIZE))))
                .addContainerGap(12, Short.MAX_VALUE))
        );
        jPanel9Layout.setVerticalGroup(
            jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel9Layout.createSequentialGroup()
                .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtNombreTabla, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(10, 10, 10)
                .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel6, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtPK, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel14, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtPK1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );

        jPanel10.setBorder(javax.swing.BorderFactory.createTitledBorder("Datos Generales"));

        jLabel7.setText("Nombre Columna:");

        txtNombreColumnaAtributo.setEnabled(false);

        jPanel11.setBorder(javax.swing.BorderFactory.createEtchedBorder());

        CheckIsNull.setText("Not Null");
        CheckIsNull.setEnabled(false);

        jLabel9.setText("Longitud:");

        txt_leng.setEnabled(false);

        javax.swing.GroupLayout jPanel11Layout = new javax.swing.GroupLayout(jPanel11);
        jPanel11.setLayout(jPanel11Layout);
        jPanel11Layout.setHorizontalGroup(
            jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel11Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(CheckIsNull)
                    .addGroup(jPanel11Layout.createSequentialGroup()
                        .addComponent(jLabel9)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(txt_leng, javax.swing.GroupLayout.PREFERRED_SIZE, 62, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(20, Short.MAX_VALUE))
        );
        jPanel11Layout.setVerticalGroup(
            jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel11Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(CheckIsNull)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel9)
                    .addComponent(txt_leng, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jPanel12.setBorder(javax.swing.BorderFactory.createEtchedBorder());

        jLabel12.setText("Nombre Tabla Cruzada");

        txtNombreTablaCruzada.setEnabled(false);

        jLabel13.setText("Nombre Id Tabla Hija");

        txt_IDTablaHija.setEnabled(false);

        jLabel11.setText("Nombre Id Tabla Padre");

        txt_IDtabla_Padre.setEnabled(false);

        javax.swing.GroupLayout jPanel12Layout = new javax.swing.GroupLayout(jPanel12);
        jPanel12.setLayout(jPanel12Layout);
        jPanel12Layout.setHorizontalGroup(
            jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel12Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel12Layout.createSequentialGroup()
                        .addComponent(jLabel11)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(txt_IDtabla_Padre, javax.swing.GroupLayout.DEFAULT_SIZE, 168, Short.MAX_VALUE))
                    .addGroup(jPanel12Layout.createSequentialGroup()
                        .addGroup(jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jLabel13)
                            .addComponent(jLabel12))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(txt_IDTablaHija, javax.swing.GroupLayout.DEFAULT_SIZE, 169, Short.MAX_VALUE)
                            .addComponent(txtNombreTablaCruzada, javax.swing.GroupLayout.DEFAULT_SIZE, 169, Short.MAX_VALUE))))
                .addContainerGap())
        );
        jPanel12Layout.setVerticalGroup(
            jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel12Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel11)
                    .addComponent(txt_IDtabla_Padre, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(txt_IDTablaHija, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel13))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel12)
                    .addComponent(txtNombreTablaCruzada, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout jPanel10Layout = new javax.swing.GroupLayout(jPanel10);
        jPanel10.setLayout(jPanel10Layout);
        jPanel10Layout.setHorizontalGroup(
            jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel10Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanel12, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jPanel11, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(jPanel10Layout.createSequentialGroup()
                        .addComponent(jLabel7)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(txtNombreColumnaAtributo, javax.swing.GroupLayout.PREFERRED_SIZE, 202, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(18, Short.MAX_VALUE))
        );
        jPanel10Layout.setVerticalGroup(
            jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel10Layout.createSequentialGroup()
                .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel7)
                    .addComponent(txtNombreColumnaAtributo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jPanel11, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel12, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        );

        jPanel13.setBorder(javax.swing.BorderFactory.createTitledBorder(""));

        jList2.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
        jScrollPane2.setViewportView(jList2);

        javax.swing.GroupLayout jPanel13Layout = new javax.swing.GroupLayout(jPanel13);
        jPanel13.setLayout(jPanel13Layout);
        jPanel13Layout.setHorizontalGroup(
            jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel13Layout.createSequentialGroup()
                .addComponent(comboNombreClase, javax.swing.GroupLayout.PREFERRED_SIZE, 220, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(114, Short.MAX_VALUE))
            .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 334, Short.MAX_VALUE)
        );
        jPanel13Layout.setVerticalGroup(
            jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel13Layout.createSequentialGroup()
                .addComponent(comboNombreClase, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 178, Short.MAX_VALUE))
        );

        jToolBar2.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.RAISED));
        jToolBar2.setRollover(true);

        Agregar1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Iconos/Arrow Down_16x16-32.gif"))); // NOI18N
        Agregar1.setText("Agregar");
        Agregar1.setBorder(null);
        Agregar1.setFocusable(false);
        Agregar1.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);
        Agregar1.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        jToolBar2.add(Agregar1);
        jToolBar2.add(jSeparator4);

        jButton4.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Iconos/Delete_01_16x16-32.gif"))); // NOI18N
        jButton4.setText("Eliminar");
        jButton4.setBorder(null);
        jButton4.setFocusable(false);
        jButton4.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        jToolBar2.add(jButton4);
        jToolBar2.add(jSeparator5);

        jButton5.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Iconos/FloppyBlue2_16x16-32.gif"))); // NOI18N
        jButton5.setText("Guardar");
        jButton5.setBorder(null);
        jButton5.setFocusable(false);
        jButton5.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);
        jButton5.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        jToolBar2.add(jButton5);
        jToolBar2.add(jSeparator6);

        jButton6.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Iconos/database-up_16x16-32.gif"))); // NOI18N
        jButton6.setText("Generar Mappings");
        jButton6.setBorder(null);
        jButton6.setFocusable(false);
        jButton6.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);
        jButton6.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        jToolBar2.add(jButton6);

        jButton3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Iconos/0025-search.gif"))); // NOI18N
        jButton3.setText("Buscar Clase Mappings");
        jButton3.setPreferredSize(new java.awt.Dimension(113, 25));

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addComponent(jPanel9, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addContainerGap())
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addComponent(jPanel10, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addGap(39, 39, 39))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jPanel13, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jToolBar2, javax.swing.GroupLayout.DEFAULT_SIZE, 350, Short.MAX_VALUE))
                        .addGap(39, 39, 39))
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addComponent(jButton3, javax.swing.GroupLayout.PREFERRED_SIZE, 169, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addContainerGap())))
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jButton3, javax.swing.GroupLayout.DEFAULT_SIZE, 25, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel9, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel10, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(4, 4, 4)
                .addComponent(jToolBar2, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel13, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(24, 24, 24))
        );

        jTabbedPane1.addTab("Mappings", jPanel3);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jTabbedPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 404, javax.swing.GroupLayout.PREFERRED_SIZE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jTabbedPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 723, javax.swing.GroupLayout.PREFERRED_SIZE)
        );
    }// </editor-fold>//GEN-END:initComponents

    private void txtNombreClaseFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_txtNombreClaseFocusLost

        if(txtNombreClase.getText().trim().isEmpty()){
            MensajesAMostrar.mensajedeAdvertencia("No Ingreso el nombre de la clase");
            //TODO falta asignar el foco al txtNombreClase

        }else if(Controlador_GestorDeClases.getInstancia().verificarExistenciadeClase(txtNombreClase.getText().trim())){
            MensajesAMostrar.mensajedeAdvertencia("La Clase ya existe");
        }

        
        //Metodo que permite verificar si la clase ya existe cuando sale del foto mostrando un mensaje de Advertencia
}//GEN-LAST:event_txtNombreClaseFocusLost
public void borrarCombo(){
     ComboClasesExistetnes.removeAllItems();
    }

public  void cargarComboClasesExistentes(ArrayList<Clase> c){
      borrarCombo();

      Iterator i=c.iterator();

      while(i.hasNext()){
        ComboClasesExistetnes.addItem((Clase)i.next());
      }

      }
    private void chkExtendItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_chkExtendItemStateChanged
        if(chkExtend.isSelected()){

            txt_clasequeExtiende.setEditable(true);

        }else txt_clasequeExtiende.setEditable(false);        // TODO add your handling code here:
}//GEN-LAST:event_chkExtendItemStateChanged


public void cargame(){

            cargarComboClasesExistentes(Controlador_GestorDeClases.getInstancia().getClasesExistentes());
        Boton_AgregarATRIBUTO_Lista.setEnabled(true);
        
}


    private void ckEsEnumeracionItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_ckEsEnumeracionItemStateChanged
        if(ckEsEnumeracion.isSelected()){

            txt_paqueteEnumeracion.setEditable(true);

        }else txt_paqueteEnumeracion.setEditable(false);
        // TODO add your handling code here:
}//GEN-LAST:event_ckEsEnumeracionItemStateChanged

    private void ckEsEnumeracionActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ckEsEnumeracionActionPerformed
        // TODO add your handling code here:
}//GEN-LAST:event_ckEsEnumeracionActionPerformed

    private void ComboClasesExistetnesItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_ComboClasesExistetnesItemStateChanged

        if(!ComboClasesExistetnes.getSelectedItem().toString().isEmpty()){

            int i=(int)ComboClasesExistetnes.getSelectedIndex();

            if(i==0||i==1||i==2||i==3||i==4){
                ComboMultiplicidad.setEnabled(false);
            } else {ComboMultiplicidad.setEnabled(true);}

            if(((Clase)ComboClasesExistetnes.getSelectedItem()).getNombreDeClase().equalsIgnoreCase("String")||((Clase)ComboClasesExistetnes.getSelectedItem()).getNombreDeClase().equalsIgnoreCase("Bool") ){
                ckOpcional.setEnabled(false);
            }else ckOpcional.setEnabled(true);
        }   else  ComboClasesExistetnes.setSelectedIndex(0);
    }//GEN-LAST:event_ComboClasesExistetnesItemStateChanged
/**/
    private void ComboClasesExistetnesFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_ComboClasesExistetnesFocusLost
        /*(ComboClasesExistetnes.getSelectedItem().toString().isEmpty()){
            ComboClasesExistetnes.setSelectedIndex(0);
        }*/
        // TODO add your handling code here:
}//GEN-LAST:event_ComboClasesExistetnesFocusLost

    private void ListaAtributosValueChanged(javax.swing.event.ListSelectionEvent evt) {//GEN-FIRST:event_ListaAtributosValueChanged
        if(!ListaAtributos.isSelectionEmpty()){
            boton_Eliminar_Metodo.setEnabled(true);
            
        }
}//GEN-LAST:event_ListaAtributosValueChanged

    private void Boton_AgregarATRIBUTO_ListaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_Boton_AgregarATRIBUTO_ListaActionPerformed
        if(txtNombreAtributo.getText().isEmpty()){
            MensajesAMostrar.mensajedeAdvertencia("Tiene que Ingresar el nombre del Atributo");
        }else {modelListaAtributos.addElement(this.tomarAtributo());
                
       }
    }//GEN-LAST:event_Boton_AgregarATRIBUTO_ListaActionPerformed

    private void boton_Eliminar_MetodoMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_boton_Eliminar_MetodoMouseClicked

        if(!ListaAtributos.isSelectionEmpty()){
            modelListaAtributos.removeElementAt(ListaAtributos.getSelectedIndex());
            if(ListaAtributos.isSelectionEmpty()){
                boton_Eliminar_Metodo.setEnabled(false);
            }

        }
}//GEN-LAST:event_boton_Eliminar_MetodoMouseClicked
public Atributo tomarAtributo(){

      Atributo a=new Atributo();
      a.setAcceso(obtenerAccesoDeClASE(radio_Atributo_Public,radio_Atributo_Private,radio_Atributo_Protected));
      a.setNombre(txtNombreAtributo.getText().trim());
      a.setTipoRetorno(this.obtenerEnumeracionDECombo());
      a.setIsOpcional(ckOpcional.isSelected());
      a.setMultiplicidad(this.obtenerMultiplicidad());
      a.setIsEnumeracion(ckEsEnumeracion.isSelected());
      a.setPaqueteNumeracion(txt_paqueteEnumeracion.getText().trim());
      a.setObservaciones(areaObservaciones.getText());

          return a;
      }



public Clase TomarClase(){

Clase c=new Clase();

c.setAcceso(obtenerAccesoDeClASE(radio_Clase_Public, radio_Clase_Private, radio_Clase_Private));
c.setNombreDeClase(txtNombreClase.getText().trim());
c.setIsExtend(chkExtend.isSelected());
c.setClaseQueExtiende(txt_clasequeExtiende.getText().trim());
c.setIdentificadordeClase(2);

Atributo a=null;
 for(int i=0;i<modelListaAtributos.getSize();i++){

     a=(Atributo)modelListaAtributos.getElementAt(i);


     c.getAtributos().add(a);

 }

return c;
}

public void tomarAtributosdelModelo(Clase c){
 Atributo a=null;
 for(int i=0;i<modelListaAtributos.getSize();i++){

     a=(Atributo)modelListaAtributos.getElementAt(i);


     c.guardarAtributoAArray(a);

 }

}

public AccesoEnum obtenerAccesoDeClASE(JRadioButton pub,JRadioButton priv,JRadioButton prot){

          AccesoEnum acceso=null;

          if(pub.isSelected()){
              acceso=AccesoEnum.PUBLIC;

          }else if(priv.isSelected()){
              acceso=AccesoEnum.PRIVATE;

          }else if(prot.isSelected()){
              acceso=AccesoEnum.PROTECTED;

          }

 return acceso;
      }

public EnumMultiplicidad obtenerMultiplicidad(){

   EnumMultiplicidad e_m = null;
        switch(ComboMultiplicidad.getSelectedIndex()){

            case 0:
                  e_m =EnumMultiplicidad.ZERO_TO_ONE;
                  break;

            case 1:
                  e_m =EnumMultiplicidad.ZERO_TO_MANY;
                  break;

            case 2:
                  e_m =EnumMultiplicidad.ONE_TO_ONE;
                  break;

                   case 3:
                  e_m =EnumMultiplicidad.ONE_TO_MANY;
                  break;

                 case 4:
                  e_m =EnumMultiplicidad.MANY_TO_MANY;
                  break;
        }
return e_m;

}

public Clase obtenerEnumeracionDECombo(){
Clase c=null;
   if(ComboClasesExistetnes.getSelectedItem() instanceof String){
       c=new Clase(ComboClasesExistetnes.getSelectedItem().toString(),false);
   }else c=(Clase)ComboClasesExistetnes.getSelectedItem();

return c;
}


public  void MostrarClaseAModificar(String n){
   nada(n);
}

public void nada(String nombre){
     txtNombreClase.setText(nombre);
     System.out.println("me llamo maxi");
}

public  void AgregarAListaAtributosAmodificar(ArrayList<Atributo> a){

  
  Iterator i=a.iterator();
  modelListaAtributos.clear();
  while(i.hasNext()){
      modelListaAtributos.addElement((Atributo)i.next());
  }
}


    private void Boton_GuardarClaseActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_Boton_GuardarClaseActionPerformed

        if(!txtNombreClase.getText().trim().isEmpty()){

            Clase c=Controlador_GestorDeClases.getInstancia().ValidarExistenciaClasesACrear(txtNombreClase.getText());

            if(c!=null){

                this.Update(c);
                 MensajesAMostrar.mensajedeAdvertencia("La Clase Fue Modificada");
                 txtNombreClase.setText("");
                 txtNombreAtributo.setText("");
                 modelListaAtributos.clear();

            }else {
            Clase clase=TomarClase();
            if(ClaseValidacion.getInstancia().validame(clase.getNombreDeClase())){
            Controlador_GestorDeClases.getInstancia().CargarClasesExistentes(clase);
            Controlador_GestorDeClases.getInstancia().getClasesACrear().add(clase);
            //Controlador_GestorDeCodigo.crearCodigoClase(c); lo comento porque no se tendria uqe crear el codigo ni bien guardo la clase doy la opcion desp
            MensajesAMostrar.mensajedeAdvertencia("La Clase Fue Guardada");
            txtNombreClase.setText("");
            txtNombreAtributo.setText("");
            modelListaAtributos.clear();
            
            }
            }
        }else MensajesAMostrar.mensajedeAdvertencia("No ingreso el nombre de la clase");
    }//GEN-LAST:event_Boton_GuardarClaseActionPerformed

public Clase Update(Clase c){

c.setAcceso(obtenerAccesoDeClASE(radio_Clase_Public, radio_Clase_Private, radio_Clase_Private));
c.setNombreDeClase(txtNombreClase.getText().trim());
c.setIsExtend(chkExtend.isSelected());
c.setClaseQueExtiende(txt_clasequeExtiende.getText().trim());
c.setIdentificadordeClase(2);

c.getAtributos().clear();//borro el array de Atributos;
Atributo a=null;
 for(int i=0;i<modelListaAtributos.getSize();i++){

     a=(Atributo)modelListaAtributos.getElementAt(i);

     c.getAtributos().add(a);
 }
return c;
}
    


    private void boton_buscarClasesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_boton_buscarClasesActionPerformed
        new PanelClases().setVisible(true);

    }//GEN-LAST:event_boton_buscarClasesActionPerformed

public void mostrarClaseAModificar(Clase c){
   AgregarAListaAtributosAmodificar(c.getAtributos());
    txtNombreClase.setText(c.getNombreDeClase());

}

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton Agregar1;
    private javax.swing.JButton Boton_AgregarATRIBUTO_Lista;
    private javax.swing.JButton Boton_GuardarClase;
    private javax.swing.JCheckBox CheckIsNull;
    private javax.swing.JComboBox ComboClasesExistetnes;
    private javax.swing.JComboBox ComboMultiplicidad;
    private javax.swing.JList ListaAtributos;
    private javax.swing.JLabel Paquete;
    private javax.swing.JTextArea areaObservaciones;
    private javax.swing.JButton boton_Eliminar_Metodo;
    private javax.swing.JButton boton_GenerarClase;
    private javax.swing.JButton boton_buscarClases;
    private javax.swing.ButtonGroup buttonGroup1;
    private javax.swing.ButtonGroup buttonGroup2;
    private javax.swing.JCheckBox chkExtend;
    private javax.swing.JCheckBox ckEsEnumeracion;
    private javax.swing.JCheckBox ckOpcional;
    private javax.swing.JComboBox comboNombreClase;
    private javax.swing.JButton jButton3;
    private javax.swing.JButton jButton4;
    private javax.swing.JButton jButton5;
    private javax.swing.JButton jButton6;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JList jList2;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel10;
    private javax.swing.JPanel jPanel11;
    private javax.swing.JPanel jPanel12;
    private javax.swing.JPanel jPanel13;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel5;
    private javax.swing.JPanel jPanel6;
    private javax.swing.JPanel jPanel7;
    private javax.swing.JPanel jPanel8;
    private javax.swing.JPanel jPanel9;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane3;
    private javax.swing.JToolBar.Separator jSeparator1;
    private javax.swing.JToolBar.Separator jSeparator2;
    private javax.swing.JToolBar.Separator jSeparator3;
    private javax.swing.JToolBar.Separator jSeparator4;
    private javax.swing.JToolBar.Separator jSeparator5;
    private javax.swing.JToolBar.Separator jSeparator6;
    private javax.swing.JTabbedPane jTabbedPane1;
    private javax.swing.JToolBar jToolBar1;
    private javax.swing.JToolBar jToolBar2;
    private javax.swing.JRadioButton radio_Atributo_Private;
    private javax.swing.JRadioButton radio_Atributo_Protected;
    private javax.swing.JRadioButton radio_Atributo_Public;
    private javax.swing.JRadioButton radio_Clase_Private;
    private javax.swing.JRadioButton radio_Clase_Protected;
    private javax.swing.JRadioButton radio_Clase_Public;
    private javax.swing.JTextField txtNombreAtributo;
    private javax.swing.JTextField txtNombreClase;
    private javax.swing.JTextField txtNombreColumnaAtributo;
    private javax.swing.JTextField txtNombreTabla;
    private javax.swing.JTextField txtNombreTablaCruzada;
    private javax.swing.JTextField txtPK;
    private javax.swing.JTextField txtPK1;
    private javax.swing.JTextField txt_IDTablaHija;
    private javax.swing.JTextField txt_IDtabla_Padre;
    private javax.swing.JTextField txt_clasequeExtiende;
    private javax.swing.JTextField txt_leng;
    private javax.swing.JTextField txt_paqueteEnumeracion;
    // End of variables declaration//GEN-END:variables


}